home *** CD-ROM | disk | FTP | other *** search
/ Mac Cube 4: Multimedia Applications / MacCube Volume 4: Multimedia Applications.iso / Graphics / POV Ray / POVRAY II (68040) / Colonne.POV < prev    next >
Text File  |  1995-10-24  |  4KB  |  170 lines

  1. //   Persistence Of Vision raytracer version 2.0 sample file.
  2. //    You will need the "Pov-Ray (68040)" version to run it.
  3.  
  4. /*
  5.                                                 ! WARNING !
  6.      
  7.      This file has been disigned to be rendered with an unofficial
  8.      version of Pov-Ray, which is not supported by the POV-Ray team.
  9.      You can get this version by anonymous ftp at the following address
  10.                       sumex-aim.stanford.edu (36.44.0.6) 
  11.                    and download the "POV-68040.hqx" package.
  12.      
  13.    This version supports trigonometric fuctions and loops in the scene description.
  14.    You will need a 68040 tu run it, but you will be able to render scenes quicker
  15.    than with the official version. The speed gain ranges from 3% to 42% (average 12%)
  16.  
  17. */
  18.  
  19. // Example using loops to describe a scene.
  20. // 5 carved columns in granite lying on water.
  21. // For a quick look of the columns,
  22. // you may want to remove the ground in order
  23. // to increase the rendering speed.
  24.  
  25. // ©N.Guex, March 1994
  26.  
  27. /*
  28.   You can use, modify and include these columns freely in your scenes,
  29.   BUT : WARNING !
  30. • If you decide to share or post a scene that need any of the new features
  31. • to be rendered, you MUST indicate clearly that this scene was designed
  32. • specifically for my version and that it will request it to be rendered.
  33. • Specify also where users can find my version, and the type of computer
  34. • needed (Macintosh with 68040).
  35. • This is only to insure that regular users will not be confused with some
  36. • scenes that they are unable to render.
  37. */
  38.  
  39. #include "FOV.inc"
  40. #include "colors.inc"
  41. #include "textures.inc"
  42. #include "shapes.inc"
  43.  
  44. #declare posCamera = <0 ,10 ,-50 >           
  45. #declare lookWhere = <0, -600, 6000>           
  46. #declare XLight1 = -20                  
  47. #declare YLight1 = 35                  
  48. #declare ZLight1 = -30                
  49.  
  50. //••••••••••• Ligths & Camera •••••••••••
  51.  
  52. camera {
  53.    location  posCamera
  54.    direction <0 0 FoV_15>
  55.    up        <0 10 0>
  56.    right     <13.3 0 0>
  57.    sky       <0 10 0>
  58.    look_at   lookWhere  
  59.    rotate <0 0 0>        
  60. }
  61.  
  62. object { 
  63.   light_source { <XLight1, YLight1, ZLight1>       
  64.                  color red 2 green 2 blue 2 }
  65. }
  66. object { 
  67.   light_source { <-XLight1, -YLight1, ZLight1>       
  68.                  color red 1 green 1 blue 1 }
  69. }
  70.  
  71. //••••••• T E X T U R E S ••••••••
  72.  
  73. #declare ColumnTexture =
  74.   texture {
  75.     pigment {
  76.       granite
  77.                   turbulence 0.3
  78.       rotate <0 0 90>      
  79.       scale <.2 .07 .15>
  80.     }
  81.     finish {
  82.       reflection 0
  83.       ambient .1  
  84.                      diffuse .6
  85.                         phong 1
  86.     }
  87.   }
  88.  
  89. //••••••• O B J E C T S ••••••••
  90.  
  91. //-------------------------------------------------
  92. // Declare a carved Column
  93. //-------------------------------------------------
  94.  
  95. #declare n = 10        /* nbr of cylinders to carve at the column surface */
  96. #declare r1 = 5                                          /* column radius */
  97. #declare carvingDepth2 = +sqr(1.2)          /* value  must be >1 */
  98. #declare a = 360 / n     /* angle between two centers of carving cylinders */
  99.  
  100. #declare xx = r1 * sin(a/2)          /* just to make further calculs easy */
  101.  
  102. /* carving cylinder radius */
  103. #declare r2 = xx * sqrt(carvingDepth2 / (carvingDepth2 -1)) 
  104.  
  105. /* dist between column center and carving cylinder center */
  106. #declare d = +sqrt(sqr(r1)- sqr(xx)) + sqrt(sqr(r2)- sqr(xx))             
  107.  
  108. #declare Column =
  109.  object {                                          
  110.    difference {
  111.       intersection {
  112.         object { Cylinder_Y scale < r1 r1 r1 > }
  113.         box { <-r1 , -r1,  -r1> <r1, r1,  r1> } 
  114.       }
  115.       FOR angle <0 360 a> 
  116.       object { Cylinder_Y 
  117.                  scale < r2 r2 r2 >
  118.                  translate < d* cos(angle),  0,   d * sin(angle) > 
  119.       } 
  120.       ENDFOR
  121.    }  
  122.   texture { ColumnTexture }
  123.  }
  124.  
  125. //••••••••••• I M A G E ••••••••••••
  126.  
  127. // ----  pentacle constituted of 5 carved columns -------
  128.  
  129. #declare dev = 20
  130. #declare dist = 20
  131. #declare col_scale = .5
  132.  
  133. FOR i <0+dev, 360+dev, 360/5> 
  134. object { Column  scale < col_scale, 6.5*col_scale, col_scale >
  135.             translate < dist*sin(i), 0, dist*cos(i)> 
  136. }
  137. ENDFOR
  138.  
  139. //--------- GROUND --------- 
  140.  
  141. object {
  142.   plane { <0 1 0> 0 }
  143.   texture {
  144.     pigment {
  145.       color red 0 green 0 blue 0 
  146.     }
  147.     finish {
  148.       reflection 0
  149.       ambient 0
  150.       diffuse 0
  151.     }
  152.   }
  153.   texture {
  154.     pigment {
  155.       Sapphire_Agate
  156.       scale <5 5 5 > 
  157.     }
  158.     normal { wrinkles 1 }
  159.     finish {
  160.       reflection 0.8
  161.                      diffuse 1.1
  162.                         phong 1
  163.     }
  164.  }
  165.  
  166.  scale <.4 .4 .4>
  167.  translate < 0 0 0 >
  168. }
  169.  
  170.